﻿<navigation:Page x:Class="PmuRegistry.Silverlight.Pages.Comments" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"    
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:common="clr-namespace:System.Windows;assembly=System.Windows.Controls"
                 xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
           Title="NASPI PMU Registry: User Comments or Suggestions">
    <Grid x:Name="GridComments">

        <Border Style="{StaticResource PortletBorderStyle}">
            <StackPanel Orientation="Vertical">
                        
                <!--<StackPanel.Resources>
                    <common:HierarchicalDataTemplate x:Key="ChildNodeTemplate">                        
                            <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                <TextBlock Text="" TextWrapping="Wrap" Height="0" TextAlignment="Left" Padding="1"/>
                            </Border>                                                    
                    </common:HierarchicalDataTemplate>
                    <common:HierarchicalDataTemplate x:Key="RootNodeTemplate" ItemTemplate="{StaticResource ChildNodeTemplate}" ItemsSource="{Binding Path=Comment}">                        
                        <StackPanel Orientation="Vertical">
                            <Border Style="{StaticResource HeaderRowBorderStyle}">
                                <StackPanel Orientation="Horizontal" Margin="2">
                                    <TextBlock Text="" Width="{StaticResource BlankItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                                    <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                                        <TextBlock Text="{Binding Path=Subject}" Width="{StaticResource XXXLargeItemSize}" TextAlignment="Left" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold" Padding="1"/>
                                    </Border>
                                    <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                                        <TextBlock Text="{Binding Path=UserName}" Width="{StaticResource LargeItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold" Padding="1"/>
                                    </Border>
                                    <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                                        <TextBlock Text="{Binding Path=CreatedOn}" Width="{StaticResource LargerItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold" Padding="1"/>
                                    </Border>
                                </StackPanel>
                            </Border>
                            <TextBlock Text="{Binding Path=Comment}" TextWrapping="Wrap" TextAlignment="Left" VerticalAlignment="Top" Padding="1"/>
                        </StackPanel>
                    </common:HierarchicalDataTemplate>
                <Style x:Key="ExpandedItemStyle" TargetType="controls:TreeViewItem">
                    <Setter Property="IsExpanded" Value="True" />
                </Style>
                </StackPanel.Resources>-->
                

                <TextBlock Text="Submit Comments or Suggestions" Foreground="#FFFFFFFF" HorizontalAlignment="Center" FontSize="{StaticResource LargerTextSize}" Padding="5" />
                <Border Background="{StaticResource PortletBackgroundBrush}">
                    <Grid x:Name="GridSubmitComment" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="3*" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="4*" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
                            <TextBlock Text="Subject" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxSubject" Grid.Row="0" Grid.Column="1" Width="{StaticResource XXXLargeItemSize}" Height="{StaticResource XXXSmallItemSize}" MaxLength="128" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0">
                            <TextBlock Text="Comment" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxComment" Grid.Row="1" Grid.Column="1" Width="{StaticResource XXXLargeItemSize}" Height="{StaticResource SmallerItemSize}" TextWrapping="Wrap" MaxLength="1024" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center">
                            <Button x:Name="ButtonClear" Content="../../Images/Cancel.png" Tag="Clear" Template="{StaticResource ImageButtonTemplate}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5" Cursor="Hand">
                                <Button.RenderTransform>
                                    <ScaleTransform x:Name="ButtonClearTransform" ScaleX="1" ScaleY="1" />
                                </Button.RenderTransform>
                            </Button>
                            <TextBlock Text="     "/>
                            <Button x:Name="ButtonSave" Content="../../Images/Save.png" Tag="Save" Template="{StaticResource ImageButtonTemplate}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5" Cursor="Hand">
                                <Button.RenderTransform>
                                    <ScaleTransform x:Name="ButtonSaveTransform" ScaleX="1" ScaleY="1" />
                                </Button.RenderTransform>
                            </Button>
                        </StackPanel>
                    </Grid>
                </Border>
                <Border Background="{StaticResource PortletBackgroundBrush}">
                    <ScrollViewer BorderThickness="0" Padding="0" Height="428">
                        <ScrollViewer.Content>
                            <ListBox x:Name="ListBoxCommentList" Margin="0" Padding="0">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" ToolTipService.ToolTip="{Binding Path=Comment}">
                                            <StackPanel Orientation="Horizontal" Margin="2">                                                                                                
                                                    <TextBlock Text="{Binding Path=Subject}" Width="450" TextAlignment="Left" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold" Padding="1"/>
                                                    <TextBlock Text="{Binding Path=UserName}" Width="{StaticResource LargeItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold" Padding="1"/>
                                                    <TextBlock Text="{Binding Path=CreatedOn}" Width="{StaticResource LargerItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold" Padding="1"/>
                                            </StackPanel>
                                            <TextBlock Text="{Binding Path=Comment}" Width="750" TextWrapping="Wrap" TextAlignment="Left" VerticalAlignment="Top" Padding="1"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </ScrollViewer.Content>
                    </ScrollViewer>
                </Border>
                <data:DataPager x:Name="DataPagerComments" PageSize="10" AutoEllipsis="True" NumericButtonCount="3" DisplayMode="FirstLastPreviousNext"/>
                <!--<ScrollViewer BorderThickness="0" Padding="0" Height="450">
                        <ScrollViewer.Content>
                            <controls:TreeView x:Name="TreeViewComments" Background="{StaticResource PortletBackgroundBrush}" ItemTemplate="{StaticResource RootNodeTemplate}" Height="425" ItemContainerStyle="{StaticResource ExpandedItemStyle}" />
                        </ScrollViewer.Content>
                    </ScrollViewer>-->
                
            </StackPanel>
        </Border>
        
    </Grid>
</navigation:Page>
